package com.siashan.toolkit.oss.aliyun;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 阿里云OSS自动配置
 *
 * @author siashan
 * @since v1.0.1
 **/
@Configuration
@EnableConfigurationProperties(AliyunOssProperties.class)
public class AliyunOssAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public AliyunOssProperties aliyunOssProperties() {
        return new AliyunOssProperties();
    }


    @Bean
    @ConditionalOnMissingBean
    public AliyunOssFactoryProvider aliyunOssFactoryProvider(AliyunOssProperties aliyunOssProperties) {
        return new AliyunOssFactoryProvider(aliyunOssProperties);
    }
}
